<template>
	<Col :span="column.span || span" v-bind="column.colProps || col">
		<template v-if="hasChildren(column)">
			<template v-for="(child, childIndex) in column.children" :key="childIndex">
				<iv-group-item :column="child" :data="data" :group-renders="groupRenders" :size="size" :span="span" :col="col" />
			</template>
		</template>
		<template v-else>
			<iv-single-item :column="column" :data="data" :group-renders="groupRenders" :size="size" />
		</template>
	</Col>
</template>

<script>
import IvSingleItem from './iv-single-item.vue'
export default {
	name: 'IvGroupItem',
	components: {
		IvSingleItem
	},
	props: {
		data: {
			type: Object,
			default() {
				return {}
			}
		},
		column: {
			type: Object,
			default() {
				return {}
			}
		},
		groupRenders: {
			type: Object,
			default() {
				return {}
			}
		},
		size: {
			type: String
		},
		span: {
			type: Number,
			default: 24
		},
		col: {
			type: Object,
			default() {
				return {}
			}
		}
	}
}
</script>

<style scoped></style>
